package cmpe451.group7.ourcity.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
@Table(name = "badge")
public class Badge implements Serializable {

	private static final long serialVersionUID = 1L;

	private long badgeID;
	private String badgeName;
	private int commentOrPlace; // 0 comment 1 place 2 nor place neither comment
	private int badgeCount;

	public Badge() {
		this.badgeID = 0;
		this.badgeName = "yok";
		this.commentOrPlace = 2;
		this.badgeCount = 0;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "badgeID")
	public long getBadgeID() {
		return badgeID;
	}

	public void setBadgeID(long badgeID) {
		this.badgeID = badgeID;
	}

	@Column(name = "badgeName", unique = true, nullable = false)
	public String getBadgeName() {
		return badgeName;
	}

	public void setBadgeName(String badgeName) {
		this.badgeName = badgeName;
	}

	@Column(name = "commentOrPlace", nullable = false)
	public int getCommentOrPlace() {
		return commentOrPlace;
	}

	public void setCommentOrPlace(int commentOrPlace) {
		this.commentOrPlace = commentOrPlace;
	}

	@Column(name = "badgeCount", nullable = false)
	public int getBadgeCount() {
		return badgeCount;
	}

	public void setBadgeCount(int badgeCount) {
		this.badgeCount = badgeCount;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (badgeID ^ (badgeID >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Badge other = (Badge) obj;
		if (badgeID != other.badgeID)
			return false;
		return true;
	}

}
